package com.joysuch.wwyt.dzhapi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.joysuch.wwyt.dzhapi.bean.ApiBaseUserBean;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author JamesZY
 * @since 2021-12-07
 */
public interface ApiBaseUserMapper extends BaseMapper<ApiBaseUserBean> {
    ApiBaseUserBean findByCodeAndTenentIdAndOrgcode(String code, String orgCode, Long tenentId);

    List<ApiBaseUserBean> findBySnNullAndEmployeeIdNotNull();

    List<ApiBaseUserBean> findByJob(Long job, Long tenentId, String orgCode);

    List<ApiBaseUserBean> findByDepartId(Long departId, Long tenentId, String orgCode);

    List<ApiBaseUserBean> findBySn(String sn, Long tenentId, String orgCode);

    List<ApiBaseUserBean> findByCardNumber(String cardNumber, Long tenentId, String orgCode);

    ApiBaseUserBean findByUniqueId(String uniqueId, Long tenentId, String orgCode);

    int countOfCodeExcludeId(String code, Long id, Long tenentId, String orgCode);

    int countOfCode(String code, Long tenentId, String orgCode);

    int countByName(String realName, Long tenentId, String orgCode);

    int countBySn(String sn, Long tenentId, String orgCode);

    int countBySnExcludeSelf(String sn, Long id, Long tenentId, String orgCode);

    int countByNameExcludeSelf(String realName, Long id, Long tenentId, String orgCode);

    void updateUserState(Long id);

    void updateSyncState(Long id);
}
